package com.awei.project.service;

import com.awei.project.model.dto.teamRequest.*;
import com.awei.project.model.entity.Team;
import com.awei.project.model.entity.User;
import com.awei.project.model.vo.TeamUserVo;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author gmh
* @description 针对表【team(队伍)】的数据库操作Service
* @createDate 2024-06-25 23:23:14
*/
public interface TeamService extends IService<Team> {

        Long addTeam(TeamAddRequest teamAddRequest, User loginUser);

        List<TeamUserVo> searchTeam(TeamSearchRequest teamAddRequest, boolean isAdmin, HttpServletRequest request);

        boolean updateTeam(TeamUpdateRequest teamUpdateRequest, User loginUser);

        /**
         * 加入队伍
         *
         * @param teamJoinRequest
         * @return
         */
        boolean joinTeam(TeamJoinRequest teamJoinRequest, User loginUser);

        /**
         * 退出队伍
         *
         * @param teamQuitRequest
         * @param loginUser
         * @return
         */
        boolean quitTeam(TeamQuitRequest teamQuitRequest, User loginUser);

        /**
         * 删除（解散）队伍
         *
         * @param id
         * @param loginUser
         * @return
         */
        boolean deleteTeam(long id, User loginUser);

        /**
         * 搜索队伍
         * @param teamQuery
         * @param b
         * @return
         */
        List<TeamUserVo> listOtherOrMyTeam(TeamSearchRequest teamQuery, boolean b,HttpServletRequest request);

        List<User> listJoinUsers(Long id);

}
